<?php

namespace Application\Model\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Message
 *
 * @ORM\Table(name="message", indexes={@ORM\Index(name="fk_Messages_User1_idx", columns={"From_User_Id"}), @ORM\Index(name="fk_Messages_User2_idx", columns={"To_User_Id"}), @ORM\Index(name="fk_Messages_Projects1_idx", columns={"Projects_Id"})})
 * @ORM\Entity
 */
class Message
{
    /**
     * @var integer
     *
     * @ORM\Column(name="Id", type="integer", nullable=false)
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="NONE")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="Topic", type="string", length=45, nullable=true)
     */
    private $topic;

    /**
     * @var string
     *
     * @ORM\Column(name="Text", type="string", length=255, nullable=true)
     */
    private $text;

    /**
     * @var boolean
     *
     * @ORM\Column(name="Readed", type="boolean", nullable=true)
     */
    private $readed;

    /**
     * @var \Application\Model\Entity\Project
     *
     * @ORM\ManyToOne(targetEntity="Application\Model\Entity\Project")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="Projects_Id", referencedColumnName="Id")
     * })
     */
    private $projects;

    /**
     * @var \Application\Model\Entity\User
     *
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="NONE")
     * @ORM\OneToOne(targetEntity="Application\Model\Entity\User")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="From_User_Id", referencedColumnName="Id")
     * })
     */
    private $fromUser;

    /**
     * @var \Application\Model\Entity\User
     *
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="NONE")
     * @ORM\OneToOne(targetEntity="Application\Model\Entity\User")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="To_User_Id", referencedColumnName="Id")
     * })
     */
    private $toUser;



    /**
     * Set id
     *
     * @param integer $id
     * @return Message
     */
    public function setId($id)
    {
        $this->id = $id;

        return $this;
    }

    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set topic
     *
     * @param string $topic
     * @return Message
     */
    public function setTopic($topic)
    {
        $this->topic = $topic;

        return $this;
    }

    /**
     * Get topic
     *
     * @return string 
     */
    public function getTopic()
    {
        return $this->topic;
    }

    /**
     * Set text
     *
     * @param string $text
     * @return Message
     */
    public function setText($text)
    {
        $this->text = $text;

        return $this;
    }

    /**
     * Get text
     *
     * @return string 
     */
    public function getText()
    {
        return $this->text;
    }

    /**
     * Set readed
     *
     * @param boolean $readed
     * @return Message
     */
    public function setReaded($readed)
    {
        $this->readed = $readed;

        return $this;
    }

    /**
     * Get readed
     *
     * @return boolean 
     */
    public function getReaded()
    {
        return $this->readed;
    }

    /**
     * Set projects
     *
     * @param \Application\Model\Entity\Project $projects
     * @return Message
     */
    public function setProjects(\Application\Model\Entity\Project $projects = null)
    {
        $this->projects = $projects;

        return $this;
    }

    /**
     * Get projects
     *
     * @return \Application\Model\Entity\Project 
     */
    public function getProjects()
    {
        return $this->projects;
    }

    /**
     * Set fromUser
     *
     * @param \Application\Model\Entity\User $fromUser
     * @return Message
     */
    public function setFromUser(\Application\Model\Entity\User $fromUser)
    {
        $this->fromUser = $fromUser;

        return $this;
    }

    /**
     * Get fromUser
     *
     * @return \Application\Model\Entity\User 
     */
    public function getFromUser()
    {
        return $this->fromUser;
    }

    /**
     * Set toUser
     *
     * @param \Application\Model\Entity\User $toUser
     * @return Message
     */
    public function setToUser(\Application\Model\Entity\User $toUser)
    {
        $this->toUser = $toUser;

        return $this;
    }

    /**
     * Get toUser
     *
     * @return \Application\Model\Entity\User 
     */
    public function getToUser()
    {
        return $this->toUser;
    }
}
